package cn.etynit.mms.fallback;

import cn.etynit.dto.AccountLoginDto;
import cn.etynit.exception.GlobalExceptionCodeEnum;
import cn.etynit.mms.feign.EmployeeService;
import cn.etynit.result.JsonResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class EmployeeServiceFallbackFactory implements FallbackFactory<EmployeeService> {
    @Override
    public EmployeeService create(Throwable throwable) {
        return new EmployeeService() {
            @Override
            public JsonResult accountLogin(AccountLoginDto accountLoginDto) {
                return JsonResult.error(GlobalExceptionCodeEnum.ERROR);
            }
        };
    }
}
